@extends('layouts.admin')

@section('content')

	<div class="row">
        <div class="col-lg-12">
            <div class="panel panel-primary">
              <div class="panel-heading">
                <h3 class="panel-title"><i class="fa fa-file"></i> Quản lý giải đấu</h3>
                {{ HTML::link('admin/league-add','Tạo giải đấu', array('class' => 'btn btn-success', 'style' => 'float:right; margin:20px 0px 20px 0px;')) }}
              </div>
              <div class="">
                <div class="table-responsive">
              <table class="table table-bordered table-hover table-striped tablesorter">
                  @if(isset($message))
                  <script>alert('Đã tạo')</script>
                  @endif

                  @if($allLeague == null)
                    <tbody>
                        <tr><h4 style="color: red; text-align: center; margin-top: 20px;">Chưa có giải đấu</h4></tr>
                    </tbody>
                  @else
                <thead>
                  <tr>
                    <th class="success text-header">Tên giải đấu <i class="fa"></i></th>
                    <th class="success text-header">Mô tả <i class="fa"></i></th>
                    <th class="success text-header">Hình ảnh<i class="fa"></i></th>
                    <th colspan="2" class="success text-header">Thao tác <i class="fa"></i></th>
                  </tr>
                </thead>
                <tbody>
                @foreach($allLeague as $league)
                  <tr class="active">
                    <td class="text-content text-style">{{ $league->name }}</td>
                    <td class="text-content-description">{{ $league->description }}</td>
                    <td class="text-content"><img src="../{{ $league->img_path }}" alt="Giải đấu" height="150" width="200"/></td>
                    <td class="text-content">{{ HTML::link('admin/league-modify?id='.$league->id, 'Sửa', array('class' => 'btn btn-primary')) }}</td>
                      <!--{{ Form::open(array('url' => 'admin/league-modify')) }}
                      <td>{{ Form::hidden('', $league->id , array('name' => 'id' )) }}
                          {{ Form::submit('Sửa', array('class' => 'btn btn-warning') ) }}</td>
                      {{ Form::close() }}-->

                      {{ Form::open(array('url' => 'league-delete')) }}
                      <td class="text-content">{{ Form::hidden('fuck', $league->id , array('name' => 'id' )) }}
                          {{ Form::submit('Xóa', array('class' => 'btn btn-danger')) }}
                      </td>
                      {{ Form::close() }}
                  </tr>
                @endforeach
                </tbody>
                  @endif
              </table>
            </div>
			  </div>
			</div>
		</div>
    </div>
@stop